local skill = fk.CreateSkill{
  name = "action__luojingxiashi_ol_skill",
}

Fk:loadTranslationTable{
  ["action__luojingxiashi_ol"] = "落井下石",
  ["action__luojingxiashi_ol_skill"] = "落井下石",
  [":action__luojingxiashi_ol"] = "锦囊牌<br /><b>时机</b>：进入濒死状态时<br /><b>目标</b>：一名其他角色 <br /><b>效果</b>：中止目标的濒死结算，然后你摸一张牌。",
  ["#action__luojingxiashi_ol_skill"] = "当一名其他角色进入濒死状态时，对其使用，中止其濒死结算，然后你摸一张牌",
  ["#action__luojingxiashi_ol-ask"] = "是否对 %dest 使用【落井下石】，中止其濒死结算然后你摸一张牌？",
}


skill:addEffect("cardskill", {
  mute = true,
  name = "action__luojingxiashi_ol",
  prompt = "#action__luojingxiashi_ol_skill",
  can_use = Util.FalseFunc,
  target_num = 1,
  mod_target_filter = function(self, player, to_select, selected, card)
    return to_select ~= player
  end,
  target_filter = Util.CardTargetFilter,
  on_effect = function(self, room, effect)
    effect.from:drawCards(1, skill.name)
    room.logic:breakTurn()
  end,
})


-- skill:addEffect(fk.EnterDying, {
--   priority = 10,
--   global = true,
--   mute = true,
--   can_trigger = function (self, event, target, player, data)
--     return target ~= player and table.find(player:getCardIds("h"), function(id)
--       return Fk:getCardById(id).name == "action__luojingxiashi_ol"
--     end)
--   end,
--   on_cost = function (self, event, target, player, data)
--     local room = player.room
--     local use = room:askToUseCard(player, {
--       skill_name = skill.name,
--       pattern = "action__luojingxiashi_ol",
--       prompt = "#action__luojingxiashi_ol-ask::" .. target.id,
--       extra_data = { must_targets = { data.who.id } }
--     })
--     if use then
--       event:setCostData(self, {extra_data = use})
--       return true
--     end
--   end,
--   on_use = function (self, event, target, player, data)
--     local use = event:getCostData(self).extra_data
--     -- use.responseToEvent = data
--     player.room:useCard(use)
--   end,
-- })

return skill